package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.Result;
import com.itheima.service.MenuService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Reference
    private MenuService menuService;
    @RequestMapping("/findByRoleId.do")
    public Result findByRoleId(String username){
        List<Map<String,Object>> map= menuService.findByRoleId(username);
        return new Result(true, MessageConstant.GET_USERNAME_SUCCESS,map);
    }
}
